; global descriptor table (GDT)

gdt_start:

gdt_null:		; mandatory null descriptor

; 8 bytes of zeros
dd	0x0		; dd = define double word (4 bytes)
dd	0x0


gdt_code:		; code segment

dw	0xffff		; limit(bits 0-15)
dw	0x0000		; base (bits 0-15)
db	0x00		; base (bits 16-23)
db	0b10011010	; first flags, type flag
db	0b11001111	; second flags, limit (bits 16-19)
db	0x00		; base (bits 24-31)

gdt_data:		; data segment
			; (same except for type flags)
dw	0xffff
dw	0x0000
db	0x00
db	0b10010010
db	0b11001111
db	0x00

gdt_end:


gdt_descriptor:
dw	gdt_end - gdt_start - 1		; size of the gdt
dd	gdt_start			; the start address of the gdt

CODE_SEG equ gdt_code - gdt_start	; 0x08
DATA_SEG equ gdt_data - gdt_start	; 0x10
